package com.ls.lserp.dbaccess.Dao;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.ls.lserp.common.persistence.CrudDao;
import com.ls.lserp.common.persistence.annotation.MyBatisDao;
import com.ls.lserp.dbaccess.Entity.AccountingEntity;
import com.ls.lserp.dbaccess.Entity.AccountingMtmEntity;
import com.ls.lserp.dbaccess.Entity.AccountingOrderEntity;
@MyBatisDao
public interface AccountingEntityMapper  extends CrudDao<AccountingEntity> {
    int deleteByPrimaryKey(Long accountId);

    int insert(AccountingEntity record);

    int insertSelective(AccountingEntity record);

    AccountingEntity selectByPrimaryKey(Long accountId);

    int updateByPrimaryKeySelective(AccountingEntity record);

    int updateByPrimaryKey(AccountingEntity record);
    
    List<String> findDataListByBusinessNo(String businessNo);
    
    /**
	 * 根据交易号获取交易单数据
	 * @param businessNo
	 * @return
	 */
	public AccountingMtmEntity getAccountingInfoByBusinessNo(String businessNo);
	
	/**
	 * 根据交易状态获取交易单数据集
	 * @param accountStatus
	 * @return
	 */
	public List<AccountingMtmEntity> findAccountListByStatus(String accountStatus);
	
	
	/**
	 * 交易单订单数据集
	 * 
	 * @return
	 */
	public List<AccountingOrderEntity> findAccountListOrder(@Param("prama1") String syncStatus,@Param("prama2") String deliveryStatus);
	
	/**
	 * 插入交易单数据
	 * @param accountingMtmEntity
	 */
	void insertAccountEntity(AccountingMtmEntity accountingMtmEntity);
	
	/**
	 * 插入交易单订单数据
	 * @param accountingMtmEntity
	 */
	void insertAccountingOrder(AccountingOrderEntity accountingOrderEntity);
	
	/**
	 * 更新交易单订单数据
	 * @param accountingMtmEntity
	 */
	void updateAccountingOrder(@Param("prama1") String oldSyncStatus,@Param("prama2") String deliveryStatus, @Param("prama3") String newSyncStatus);
	
	/**
	 * 更新交易单订单数据
	 * @param accountingMtmEntity
	 */
	void updateOrderDeliveryInfo(AccountingOrderEntity accountingOrderEntity);
	
	/**
	 * 更新交易单快递信息
	 * @param accountingMtmEntity
	 */
	void updataAccountingExpressNo(AccountingMtmEntity accountingMtmEntity);
	
	/**
	 * 根据交易状态获取订单id集数据
	 * @param businessNo
	 * @return
	 */
	public List<Long> findOrderIdListByBusinessNo(String businessNo);
	
	/**
	 * 获取导入的订单的相关交易单信息
	 * @return
	 */
	public List<AccountingMtmEntity> findImportOrdersRelevantAccountInfo();
	
	
	public List<AccountingMtmEntity> findOrderOfProductingByBusinessNo(AccountingMtmEntity accountingMtmEntity);
}